﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using PalFramework;
using PalFramework.Object;
using PalBattleEmulator.Graphic;

namespace PalBattleEmulator.Object.Unit
{
    public class Unit : PalObject, IUnit
    {
        private UnitGraphic graphicControl;

        public UnitGraphic GraphicControl
        {
            get { return graphicControl; }
            set { graphicControl = value; }
        }

        private ArrayCoordinate array = new ArrayCoordinate();

        public ArrayCoordinate Array
        {
            get { return array; }
            set { array = value; }
        }

        private ITeam team;

        public ITeam Team
        {
            get
            {
                return team;
            }
            set
            {
                team = value;
            }
        }

        public void JoinTeam(ITeam team, int index)
        {
            this.team = team;
            this.array = team.Array.Coordinates[index];
        }

        static Unit()
        {
            length = 128;

            mask = new bool[length];

            nameDictionary = new Dictionary<string, int>();
        }
    }
}
